<template>
  <div ref="ab" class="aaaa" style="width: 18.75rem; height: 100%" />
</template>

<script>
var echarts = require('echarts')
export default {
  mounted() {
    const myChartb = echarts.init(this.$refs.ab) // 得到图表实例
    myChartb.setOption({
      series: [
        {
          name: 'Radius Mode',
          type: 'pie',
          radius: [5, 35],
          center: ['50%', '50%'],
          roseType: 'radius',
          itemStyle: {
            borderRadius: 5
          },
          label: {
            show: true
          },
          data: [
            { value: 10, name: '前端' },
            { value: 8, name: 'java' },
            { value: 4, name: 'python' },
            { value: 2, name: 'c++' },
            { value: 1, name: 'UI' }
          ]
        }
      ]
    })
  }
}
</script>

<style>
.aaaa {
  margin: 0 auto;
}
</style>
